package database;

import java.io.Serializable;
import java.util.ArrayList;

public class Database implements Serializable {

	private static final long serialVersionUID = 4623941503366977085L;
	private ArrayList<Patient> patients;
	private int fontSize;
	private int fontSizeTablet;
	private boolean tablet;
	private String password;
	private String mail;
	private String owner;

	public Database() {
		patients = new ArrayList<Patient>();
		fontSize = 13;
		fontSizeTablet = 19;
		tablet = false;
		password = "b96a211fb0ae782d7b420d91fb3553d7eb6a01b9d5ca7ef5ce390262ec6fda0285365e56bf4859ccd46529ccb3ad8068ed34fe10e7e078399dc798a40be4d084";
	}

	public void addPatient(Patient a) {
		patients.add(a);
	}

	public void removePatient(Patient r) {
		patients.remove(r);
	}

	public boolean contains(Patient patient) {
		return patients.contains(patient);
	}

	public Patient getPatient(int i) {
		return patients.get(i);
	}

	public int getNumberOfPatients() {
		return patients.size();
	}

	public int getPatientNumber(Patient p) {
		return patients.indexOf(p);
	}

	public int getFontSize() {
		return fontSize;
	}

	public void setFontSize(int fontSize) {
		this.fontSize = fontSize;
	}

	public int getFontSizeTablet() {
		return fontSizeTablet;
	}

	public void setFontSizeTablet(int fontSizeTablet) {
		this.fontSizeTablet = fontSizeTablet;
	}

	public boolean isTablet() {
		return tablet;
	}

	public void setTablet(boolean tablet) {
		this.tablet = tablet;
	}

	public int getFontSizeToUse() {
		if (tablet)
			return fontSizeTablet;
		return fontSize;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getMail() {
		return mail;
	}

	public void setMail(String mail) {
		this.mail = mail;
	}

	public String getOwner() {
		return owner;
	}

	public void setOwner(String owner) {
		this.owner = owner;
	}

}